package com.ophiux.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ophiux.service.GateWayService;

@RestController
public class TestController {
	@Autowired
	GateWayService gateWayService;

	//手动同步路由
	@RequestMapping("/synGateWayConfig")
	public String synGateWayConfig() {
		 return gateWayService.loadAllRoute();
	}
	
	@RequestMapping("/saveRoute")
	public String saveRoute() {
		//1.执行数据库保存操作，将修改信息保存
		
		//2.重新加载路由信息
		synGateWayConfig();
		
		return "success";
	}
	
	@RequestMapping("/")
	public String index() {
		
		return "success";
	}
}
